import request from '@/utils/request'
//商品列表接口
export const getGoodsListAPI = (data) => request('/api/admin/goods', 'get', data)
//分类详情
export const getCategoryInfoAPI = (good) =>
    request(`/api/admin/goods/${good}?include=category`, 'get')
//上架和下架
export const changGoodsOnAPI = (good) => request(`/api/admin/goods/${good}/on`, 'PATCH')
//推荐和不推荐
export const changGoodsRecommendAPI = (good) =>
    request(`/api/admin/goods/${good}/recommend`, 'PATCH')
//新增
export const addGoodsAPI = (data) => request('/api/admin/goods', 'POST', data)
//修改
export const updateGoodsAPI = (data, good) => request(`/api/admin/goods/${good}`, 'PUT', data)
